<template>
  <div class="exhibits-content" :style="{ width: props.info.width + 'rem', height: props.info.height + 'rem' }">
    <div class="list">
      <img class="boardleft" :src="publicUrls + 'free/style10/exhibitionStandStyle3bg1sendLeft.webp'" alt="" />
      <div class="list-content">
        <div
          class="list-left"
          :style="{
            backgroundImage: `url(${publicUrls + 'free/style10/exhibitionStandStyle3bg1.webp'})`,
          }"
        ></div>
        <div
          @contextmenu.stop="emit('onContextMenuChild', $event, index)"
          v-for="(item, index) in props.info.showpieceList"
          :key="index"
          class="exhibits-item"
          :class="{ 'exhibits-item-2': (index + 1) % 2 === 0 }"
          :style="{
            backgroundImage:
              (index + 1) % 2 === 0
                ? `url(${publicUrls + 'free/style10/exhibitionStandStyle3bg4.webp'})`
                : `url(${publicUrls + 'free/style10/exhibitionStandStyle3bg2.webp'})`,
          }"
        >
          <div class="item-content" @click="viewImg(item.moduleId, item.id)">
            <div class="items-title">
              <div class="title-content">
                {{ item.name }}
              </div>
            </div>
            <div class="cover-parent">
              <div class="cover-box">
                <div class="cover">
                  <img v-lazy="getLinkUrl(item.coverUrl, '?imageView2/3/w/600/format/webp')" alt="" />
                  <!-- <FlowerCom /> -->
                </div>
              </div>
            </div>
          </div>
        </div>
        <div
          class="list-right"
          :style="{
            backgroundImage: `url(${publicUrls + 'free/style10/exhibitionStandStyle3bg3.webp'})`,
          }"
        ></div>
      </div>
    </div>
  </div>
</template> 
   
<script setup lang="ts">
import FlowerCom from '../../displayBoard/style10/flower.vue';
import { publicUrls } from '@/utils/minxin';
import { DraggableContainer } from 'vue3-draggable-resizable';
// import FlotMenu from '@/components/flotMenu/OutlineMenu.vue';
import ContextMenu from '@imengyu/vue3-context-menu';
import { getDraggableNumber, getExhibitsHeightRest, getdisabledY } from '@/utils/getRemComputed';
import { ref, reactive, watch, nextTick } from 'vue';
import { exbitMenuShow, exbitListMenuShow } from '@/hooks/menuHooks';
import { useProjectStore } from '@/store';
import { getLinkUrl } from '@/utils/request/upload';

const emit = defineEmits([
  'emitChildItemDraggable',
  'emitChildItemDraggableStyle',
  'emitShowcaseDraggable',
  'emitShowcaseDraggableStyle',
  'onContextMenuChild',
]);
const store = useProjectStore();
const contextMenuTrigger = ref(); //列表盒子dom
const parentLock = ref(true);
const childShow = ref(true);
const draggableResizable = ref(); //父级拖拽盒子ref
const timer = ref();
const ImgVisible = ref(false);
const ImgUrl = ref('');

const props = defineProps({
  width: {
    type: Number || String,
  },
  height: {
    type: Number || String,
  },
  indexs: {
    type: Number,
  },
  info: {
    type: Object,
  },
  childId: {
    type: Number,
  },
  AuxiliaryId: {
    type: Number,
  },
});

const viewImg = (moduleId: number, e?: number) => {
  store.exhibitsModuleId = moduleId;
  store.exhibitsShowpieceid = e;
  store.exhibitsInfoShow = true;
};

const handleMouseDown = (event) => {
  event.stopPropagation();
};
const preventDefaultDrag = (event) => {
  event.stopPropagation();
};
</script>
   
<style lang="less" scoped>
.exhibits-content {
  position: relative;
  display: flex;
  z-index: 999;
}
.list {
  display: flex;
  width: 100%;
  height: 100%;
}
.boardleft {
  width: 606px;
  height: 369px;
  object-fit: contain;
  margin-right: 70px;
  -webkit-box-reflect: below 320px linear-gradient(transparent, rgba(0, 0, 0, 0.3));
}
.list-content {
  display: flex;
  flex: 1;
  height: 586px;
  margin-top: 97px;
}
.list-left {
  width: 234px;
  height: 586px;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  position: relative;
  z-index: 20;
  -webkit-box-reflect: below -10px linear-gradient(transparent, rgba(0, 0, 0, 0.3));
}
.list-right {
  width: 233px;
  height: 586px;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  position: relative;
  z-index: 20;
  -webkit-box-reflect: below -10px linear-gradient(transparent, rgba(0, 0, 0, 0.3));
}
.active {
  :deep(.flot-menu) {
    display: flex;
  }
}
:deep(.active) {
  z-index: 999;
}
:deep(.vdr-handle) {
  z-index: 66;
}

.exhibits-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  width: 208px;
  height: 586px;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  padding-top: 99px;
  padding-right: 8px;
  &:nth-child(odd) {
    -webkit-box-reflect: below -0px linear-gradient(transparent, rgba(0, 0, 0, 0.3));
  }
  &:nth-child(even) {
    -webkit-box-reflect: below -50px linear-gradient(transparent, rgba(0, 0, 0, 0.3));
  }
}
.exhibits-item-2 {
  width: 208px;
  height: 586px;
  padding-top: 186px;
  padding-right: 8px;
}
.item-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 200px;
  height: 400px;
}
.cover-parent {
  position: relative;
  width: 200px;
  height: 400px;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}
.cover-box {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  width: 200px;
  height: 400px;
  overflow: hidden;
}
.cover {
  position: relative;
  width: 196px;
  height: 396px;
  object-fit: contain;
  transition: all 0.3s;
  overflow: hidden;
  img {
    width: 100%;
    height: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: all 0.3s;
  }
}
.item-content:hover {
  .items-title {
    opacity: 1;
  }
}
.items-title {
  opacity: 0;
  position: absolute;
  top: 2px;
  left: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 196px;
  height: 396px;
  z-index: 23;
  background: rgba(57, 56, 54, 0.6);
}
.title-content {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 176px;
  max-height: 48px;
  font-family: PingFang SC;
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  text-align: center;
  color: rgba(236, 235, 231, 1);
}
</style>
